import request from "@/utils/request";

/**
 * 添加部门
 */
export function addDept(data) {
  return request({
    url: "/api/dept",
    method: "post",
    data: data,
  });
}

/**
 * 删除部门
 */
export function deleteDept(id) {
  return request({
    url: `/api/dept/${id}`,
    method: "delete",
  });
}

/**
 * 更新部门
 */
export function updateDept(data) {
  return request({
    url: "/api/dept",
    method: "put",
    data: data,
  });
}

/**
 * 部门详情
 */
export function getDept(id) {
  return request({
    url: `/api/dept/${id}`,
    method: "get",
  });
}

/**
 * 部门列表
 */
export function listDept(query) {
  return request({
    url: "/api/dept",
    method: "get",
    params: query,
  });
}
